﻿<link href="../Public/css/style.css" rel="stylesheet" type="text/css" />
<!-- 加载头部公共文件 -->
<include file="../Public/head" />
<link rel="stylesheet" type="text/css" href="/Public/Js/DTree/dtree.css">
<script type="text/javascript" src="/Public/Js/DTree/dtree.js"></script>
<form method='post' action="__URL__" >
  <table width="98%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="8" height="8"><img src="../Public/images/index1_28.gif" width="8" height="39" /></td>
      <td width="99%" background="../Public/images/index1_40.gif">&nbsp;</td>
      <td width="8" height="8"><img src="../Public/images/index1_43.gif" width="8" height="39" /></td>
    </tr>
    <tr>
      <td background="../Public/images/index1_45.gif"></td>
      <td bgcolor="#FFFFFF" style="height:490px; vertical-align:top;"><table width="100%" border="0" cellspacing="10" cellpadding="0">

          <tr>
            <td>
             	<fieldset >
             		<legend>查询
             		<input name="sort_id" type="hidden" id="sort_id" value="{$sort_id}">
             		</legend>
            	<div class="row">
					标题：
					  <input name="title" type="text" id="title" value="{$title}"/>
					&nbsp;
					作者：	
					<input name="author" type="text" id="author" value="{$author}">
&nbsp;日期：
<input name="date" type="text" id="date" onClick="return fPopCalendar(this,date,'')" value="{$date}" size="10" >
            	</div>
				<div  class="row">

					<div class="impBtn hMargin fLeft shadow" >
					  <input type="submit" name="Submit" value="查询"  class="search imgButton"  />
					</div>
					<div class="impBtn hMargin fRight shadow" >
						<input type="button" name="btn_addChild" value="排序" onclick="save_sort();"  class="sort imgButton"/>
					</div>
					<div class="impBtn hMargin fRight shadow" >
						<input type="button" name="btn_addChild" value="取消置顶" onclick="setTop_artc(0);" style="width:120px" class="setTop imgButton"/>
					</div>
					<div class="impBtn hMargin fRight shadow" >
						<input type="button" name="btn_addChild" value="置顶" onclick="setTop_artc(1);" style="width:100px" class="setTop imgButton"/>
					</div>
					<div class="impBtn hMargin fRight shadow" >
						<input type="button" name="btn_addChild" value="移动" onclick="move_artc();" style="width:100px" class="move imgButton"/>
					</div>
					<div class="impBtn hMargin fRight shadow" >
					  <input type="button" name="Submit" value="删除"  class="del imgButton" onclick="del()" />
					</div>
					<div class="impBtn hMargin fRight shadow" >
					  <input type="button" name="Submit" value="修改"  class="edit imgButton" onclick="edit()" />
					</div>
					<div class="impBtn hMargin fRight shadow" >
					  <input type="button" name="Submit" value="新增"  class="add imgButton" onclick="add()" />
					</div>



				</div>
				</fieldset>
            </td>
          </tr>
          <tr>
            <td bordercolor="#DAEEF7"><table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#BBD3EB" id="tb_list">
                <tr>
                  <td width="7%" height="27" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold">
                  	<input name="cb_selAll" type="checkbox" id="cb_selAll" onclick="selAll('id[]',this);" value="1"/>
                  </td>
                  <td width="7%" height="27" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold"><label>编号</label></td>
                  <td width="7%" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold">排序</td>
                  <td width="44%" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold">标题</td>
                  <td width="10%" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold">作者</td>
                  <td width="12%" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold">日期</td>
                  <td width="12%" align="center" background="../Public/images/index1_72.gif" bgcolor="#FFFFFF" class="bold">操作</td>
                </tr>
				<volist name="list" id="vo">
                <tr bgcolor="#FFFFFF">
                  	<td height="26" align="center">
					 	 <input name="id[]" type="checkbox" id="id_{$vo.id}" value="{$vo.id}"/>
					</div>
                  	</td>
                  <td height="26" align="center">
				  	<a href="__URL__/edit/id/{$vo.id}">{$vo.id}</a>
				  </td>
                  <td align="center"><input name="sort[]" type="text" id="sort[]" value="{$vo.sort}" size="4"></td>
                  <td align="left">
				  	<eq name="vo.top" value="1">
						<img src="/Public/Images/brand.gif" border="0" title="置顶" align="absmiddle">
					</eq>
				  	<notempty name="vo.img">
						<a href="javascript:show_img('{$img_dir}{$vo.img}')" >
							<img src="/Public/Images/imgfolder.gif"  border="0" align="absmiddle" id="artc_img" style="cursor:hand " title="点击查看文章缩略图"></a>
					</notempty>
                    <eq name="vo.checked" value="0"><span style="color:#990000">【未审核】</span></eq>
                  	<a href="__URL__/edit/id/{$vo.id}" >{$vo.title}</a>
                  </td>
                  <td align="center">
				  	{$vo.author}
			  	 </td>
                  <td align="center">{$vo.date|dateFormat}</td>
                  <td align="center">
					<a href="/index.php/Artc/show/id/{$vo.id}" target="_blank">预览</a>					
					<if condition="$vo.is_show eq 1" >
						&nbsp;|&nbsp;<a href="__URL__/setShow/id/{$vo.id}/show/0" style="color:#990000" title="屏蔽:前台将不显示，后台还是可以看得到" >屏蔽</a>
					<else />
						&nbsp;|&nbsp;<a href="__URL__/setShow/id/{$vo.id}/show/1" style="color:#4BB847" title="显示文章，前台可以看见" >显示</a>
					</if>
				  </td>
                </tr>
			  </volist>
            </table></td>
          </tr>
          <tr>
            <td class="pager">{$page}</td>
          </tr>
          <tr>
            <td></td>
          </tr>
        </table>
          <h3>&nbsp;</h3>
      </td>
      <td background="../Public/images/index1_47.gif"></td>
    </tr>
    <tr>
      <td width="8" height="8"><img src="../Public/images/index1_91.gif" width="8" height="8" /></td>
      <td background="../Public/images/index1_92.gif"></td>
      <td width="8" height="8"><img src="../Public/images/index1_93.gif" width="8" height="8" /></td>
    </tr>
  </table>

</form>


<!-- js 脚本 -->
<script language="javascript">
<!--
$(document).ready(function(){

	setListStyle("tb_list");

});






function add()
{
	var sort_id = $('#sort_id').val();
	if( sort_id == '' ) 
	{
		alert('参数sort_id不能为空！');
		return ;
	}
 	location.href = "__URL__/add/sort_id/"+sort_id;
}

function edit()
{
	var id = getOneSelect('id[]');
	if( !id )
	{
		alert('请选择一条要修改的记录！');
		return ;
	}

	location.href =  "__URL__/edit/id/"+id;

}

function del()
{
	if( !getOneSelect('id[]') )
	{
		alert('请选择要删除的记录！');
		return ;
	}
	if( window.confirm('确实要删除选中的记录吗？') )
	{
		$('form').attr('action','__URL__/del');
		$('form')[0].submit();
	}
}

function move_artc()
{
	if( !getOneSelect('id[]') )
	{
		alert('请选择要移动的文章！');
		return ;
	}
	
	var url = '__APP__/Sort/sel_sort/id/'+$('#sort_id').val();
 	select_sort(url,'移动文章',function(dest_id){ 
		var url = '__URL__/moveTo/pid/'+dest_id;
		$('form').attr('action',url);
		$('form')[0].submit();
	});
}

function setTop_artc(bSet)
{
	if( !getOneSelect('id[]') )
	{
		alert('请选择要置顶的文章！');
		return ;
	}
	if( bSet )
		var url = '__URL__/setTop/bSet/1';
	else
		var url = '__URL__/setTop/bSet/0';
	$('form').attr('action',url);
	$('form')[0].submit();
}

function save_sort()
{
	if( !getOneSelect('id[]') )
	{
		alert('请选择要排序的文章！');
		return ;
	}
	var url = '__URL__/save_sort/';
	showLoading(function() {	
		$.ajax({
			url:url,
			type:'POST',
			data: $('form').serialize(),
			success: function( rt ) {
				
				if( rt == '1' )
				{
					alert('保存排序成功！');
				}
				else	
					alert('操作失败！');
				hideLoading();
	
			}
		});
	
	});	

}




//-->
</script>
<!-- 主页面结束 -->
<!-- 加载尾部公共文件 -->
<include file="../Public/foot" />